using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace nToolbox.WinForms
{
	/// <summary>
	/// XPPanel is a <see>Panel</see> control that draws using the current XP theme, including border style and text label.
	/// </summary>
	/// <para>
	/// The default WinForms panel is an unadorned container, and doesn't respect XP themes.
	/// </para>
	[Designer("System.Windows.Forms.Design.ScrollableControlDesigner")]
	public class XPPanel : Panel
	{
		[Bindable(true)]
		[Browsable(true)]
		[EditorBrowsable(EditorBrowsableState.Always)]
		public override string Text
		{
			get { return base.Text; }
			set { base.Text = value; }
		}

		protected override void OnPaint(PaintEventArgs e)
		{
			base.OnPaint(e);
			XP.GroupBoxWithControlText(e.Graphics, this);
		}
	}
}